package com.yixing.tech.system.controller;

import com.yixing.tech.common.base.*;
import com.yixing.tech.system.service.ILogService;
import com.yixing.tech.common.vo.s3.LogInfoVO;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

import static com.yixing.tech.common.security.context.UserContext.getTenantId;

/**
 * @author yixing tech
 * at 2021/12/20
 * describe：
 */
@RestController
@CrossOrigin
@RequestMapping(value = "/log")
public class LogController extends BaseControl {

    @Resource
    ILogService logService;

    @PostMapping("/list")
    public Page<LogInfoVO> list(@RequestBody PageRow<LogInfoVO> vo) throws BusinessException {
        vo.getCondition(LogInfoVO.class).setTenantId(getTenantId());
        Page<LogInfoVO> page = logService.list(vo);
        return page;
    }

}
